<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:risk="">
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <div th:replace="common::com">
    </div>
    <div th:replace="common:: left">
    </div>
    <div th:replace="common:: top">
    </div>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
<section class="content">
    <div class="col-xs-3">
    <form action="/activeClient/list">

            <div class="input-group">
                <span class="input-group-addon">系统:</span>
                <select class="form-control" id="systemName" name="systemName" >
                    <option value="">全部</option>
                    <option th:each="sys:${systemList}" th:value="${sys.systemName}" th:text="${sys.systemName}"></option>
                </select>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-2">
                <button class="btn btn-block btn-success add" onclick="searchRecord()">查询</button>
            </div>

    </form>
    <div class="col-xs-2" risk:check="/activeClient/add">
        <button class="btn btn-block btn-success add" data-toggle="modal" data-target="#addModal">新增</button>
    </div>
        </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-body">
                    <table id="job_list" class="table table-bordered table-striped" width="100%">
                        <thead>
                        <tr>
                            <th>ip</th>
                            <th>系统名</th>
                            <th>权重</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="active:${page.list}">
                            <td th:text="${active.ip}"></td>
                            <td th:text="${active.systemName}"></td>
                            <td th:text="${active.weight}"></td>
                            <td th:text="${#temporals.format(active.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td>
                                <a risk:check="/activeClient/edit/*" href="#" th:onclick="'editActive(\''+${active.id}+'\')'">编辑</a>
                                <a risk:check="/activeClient/delete/*" href="#" th:onclick="'deleteActive(\''+${active.id}+'\')'">删除</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div th:include="page::page" url="/activeClient/list"></div>
                </div>
            </div>
        </div>
    </div>
</section>
 </div>
</div>
</body>
<script src="/js/active.js"></script>
<!-- job新增.模态框 -->
<div class="modal fade system" id="addModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="height:300px;">
            <div class="modal-header">
                <h4 class="modal-title">新增执行器</h4>
            </div>
            <div class="modal-body">
                <form action="/activeClient/add" onsubmit="return false" id="addActive">
                    <label class="col-sm-2 control-label">系统名<font color="red">*</font></label>
                    <div class="col-sm-4">
                        <select class="form-control"  name="systemName" >
                            <option th:each="sys:${systemList}" th:value="${sys.systemName}" th:text="${sys.systemName}"></option>
                        </select>
                    </div>
                    <label class="col-sm-2 control-label">ip<font color="red">*</font></label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="ip" placeholder="请输入ip" maxlength="32"/>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-4" style="height:50px;">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-6">
                            <button type="submit" class="btn btn-primary" onclick="saveActive()">保存</button>
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<div class="modal fade system" id="updateModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
    <div class="modal-content" style="height:300px;">
        <div class="modal-header">
            <h4 class="modal-title">修改执行器</h4>
        </div>
        <div class="modal-body">
            <form action="/activeClient/update" onsubmit="return false" id="updateActive">
                <label class="col-sm-2 control-label">系统名<font color="red">*</font></label>
                <div class="col-sm-4">
                    <select class="form-control"  name="systemName" >
                        <option th:each="sys:${systemList}" th:value="${sys.systemName}" th:text="${sys.systemName}"></option>
                    </select>
                </div>
                <label class="col-sm-2 control-label">ip:<font color="red">*</font></label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="ip" name="ip" placeholder="请输入ip" maxlength="32"/>
                </div>
                <div class="form-group">
                    <div class="col-sm-4" style="height:50px;">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-6">
                        <button type="submit" class="btn btn-primary" onclick="updateActive()">保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <input type="hidden" name="id" id="id">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</div>
</html>
